var gulp = require('gulp'),
    autoprefixer = require('gulp-autoprefixer'),
    sass = require('gulp-sass'),
    plumber = require('gulp-plumber');

gulp.task('sass', function () {
    gulp.src('src/scss/*.scss')
        .pipe(plumber())
        .pipe(autoprefixer({
            browsers: ['last 2 versions', 'Android >= 4.0'],
            cascade: true, //是否美化属性值 默认：true 像这样：
            //-webkit-transform: rotate(45deg);
            //        transform: rotate(45deg);
            remove: true //是否去掉不必要的前缀 默认：true
        }))
        .pipe(sass())
        .pipe(gulp.dest('src/css'));
});

gulp.task('watch',function () {
   gulp.watch('src/scss/*.scss',[sass]) ;
});
gulp.task("default",['watch','sass']);
